unit HintUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RzButton, StdCtrls, RzLabel, ExtCtrls;

type
  THintForm = class(TForm)
    btn_Close: TRzBitBtn;
    lbl_Hint: TRzLabel;
    img1: TImage;
    procedure btn_CloseClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  HintForm: THintForm;

implementation
uses DMUnit;
{$R *.dfm}

procedure THintForm.btn_CloseClick(Sender: TObject);
begin
  Dec(MessageHintDisplayCount);
  Close;
end;

procedure THintForm.FormShow(Sender: TObject);
begin
  Inc(MessageHintDisplayCount);
end;

procedure THintForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

procedure THintForm.FormCreate(Sender: TObject);
var
  x,y:Integer;
begin
  x := Trunc((Screen.Width-Self.Width)/2);
  y := Trunc((Screen.Height-Self.Height)/2);
  Left := x+(MessageHintDisplayCount-1)*30;
  Top := y+(MessageHintDisplayCount-1)*50;
end;

end.
